import {
	request
} from "@/utils/request.js";

// 充值套餐
export const rechargeListApi = () => {
	return request('/index/getRechargePackage', {}, "GET")
}

// 用户余额
export const balanceDetailApi = () => {
	return request("/index/getMoney", {}, "GET")
}

// 积分明细
export const integralDetailApi = (data) => {
	return request("/index/getPointsDetails", data, "GET")
}

// 储值充值
export const rechargeApi = data => {
	return request("/index/rechargeVipUpgrade", data)
}

// 储值协议
export const rechargeAgreementApi = () => {
	return request('/index/get_stored_agreement', {}, "GET")
}

// 收益余额
export const incomeDetailApi = () => {
	return request("/index/getProfit", {}, "GET")
}

// 服务协议
export const serverAgreement = () => {
	return request('/third_api/get_serverice', {}, 'GET')
}

// 我的朋友信息
export const frendInfoApi = () => {
	return request('/third_api/friends', {}, "GET")
}


/**
 * 朋友列表
 */
export const frendListApi = (data) => {
	return request("/third_api/get_friends_data", data, 'POST')
}

/**
 * 会员/合伙人信息
 */
export const vipInfoApi = () => {
	return request('/third_api/get_vip_infos', {}, 'GET')
}
/**
 * 开通会员
 */
export const openVipApi = (data) => {
	return request("/third_api/vip_upgrade", data, "POST")
}

export const royaltyApi = (data) => {
	return request('/third_api/royalty', data, "POST")
}

/**
 * 会员权益信息
 */
export const vipInfoAPi = () => {
	return request("/third_api/get_vip_infos", {}, "GET")
}

/**
 * 提现开关
 */
export const withdrawStatusApi = () => {
	return request("/third_api/withdrawal_switch", {}, "GET")
}

/* 
	返现相关
 */
export const withdrawal = (data = {}) => {	//提现
	return request("/member/withdrawal", data, "POST")
}
export const getRebatePanelDataApi = (data = {}) => {	//面板数据
	return request("/rebate/getRebatePanelData", data, "GET")
}
export const getOrderListApi = (data = {}) => {	//订单列表
	return request("/rebate/getOrderList", data, "GET")
}
export const rejectProfitApi = (data = {}) => {	//放弃权益
	return request("/rebate/rejectProfit", data, "POST")
}
export const acceptProfitApi = (data = {}) => {	//领取权益
	return request("/rebate/acceptProfit", data, "POST")
}
export const checkProfitApi = (data = {}) => {	//检查权益
	return request("/rebate/checkProfit", data, "GET")
}
/**
 * 获取申请代理商、经销商逻辑
 */
export const cooperationLevelListApi = (data={})=>{
	return request('/third_api/level_list', data, 'GET')
}

/**
 * 申请经销商、分销商
 */
export const cooperationApplyApi = (data={})=>{
	return request('/third_api/apply', data, 'POST')
}

/**
 * 获取申请页面数据和协议
 */
export const applyInfoApi = (data={}) =>{
	return request('/third_api/getApplyResult', data, 'GET')
}

/**
 * 获取代理商、经销商申请列表
 * @param {Number} type	类型：1=分销商 2=代理商 默认2
 */
export const applyListApi = (data={})=>{
	return request('/third_api/apply_recode', data, 'GET')
}

/**
 * 获取红包随机金额
 */
export const packetMoneyApi = (data={})=>{
	return request('/Activity/getRandomMoney', data, 'GET', {toast: false})
}

/**
 * 领取红包
 * @param {Number} data.amount 红包金额
 */
export const recivePacketApi = (data = {})=>{
	return request('/Activity/collection', data, 'GET')
}